package com.wing.user.controller.admin;

import com.wing.common.utils.PageResult;
import com.wing.user.model.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhutao
 * @since 2025-06-13 10:43
 */
@Slf4j
@Validated
@Api(value = "Admin-员工管理", tags = "#/user/emp")
@RestController
@RequestMapping("/user/admin/emp")
@RequiredArgsConstructor
public class EmpController {

    private final UserController userController;

    @ApiOperation(value = "查询所有用户", notes = "搜索")
    @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "第几页", example = "1", required = true, dataType = "Integer", paramType = "query"), @ApiImplicitParam(name = "limit", value = "每页多少条", example = "10", required = true, dataType = "Integer", paramType = "query"), @ApiImplicitParam(name = "searchKey", value = "筛选条件字段", example = "phone", dataType = "String", paramType = "query"), @ApiImplicitParam(name = "searchValue", value = "筛选条件关键字", example = "13888888888", dataType = "String", paramType = "query")})
    @GetMapping("/list")
    public PageResult<User> list(Integer page, Integer limit, String searchKey, String searchValue, Long departmentId, Long postId, String username, String nickname, String phone, String idCard, String enterpriseCode, Long roleId, String isJob) {
        return userController.list(page, limit, searchKey, searchValue, departmentId, postId, username, nickname, phone, idCard, enterpriseCode, roleId, isJob);
    }
    
}
